const express=require('express');
const router=express.Router();
const PageJson=require("../model/PageJson");
const Exam_infoService=require("../services/Exam_infoService");


//获取所有考试信息
router.get("/getAllList",async (req,resp)=>{
  var exam_infoService=new Exam_infoService();
  try {
    var result=await exam_infoService.getAllList();
    if(result.length>0){
      resp.json(new PageJson("success","获取成功",result));
    }
    else{
      resp.json(new PageJson("error","获取失败,请联系管理员"));
    }
  } catch (error) {
    resp.json(new PageJson("error","服务器错误"));
  }
});

module.exports=router;